<?php

require_once('../../includes/classes/core.php');

$action 	= $_REQUEST['act'];
$error		= '';
$data		= '';

//incomming
$incom_id						= $_REQUEST['id'];
$id_p							= $_REQUEST['id_p'];
$phone							= $_REQUEST['phone'];


switch ($action) {
	case 'checker':
	    $data = array(
	       'chat' => array()
	    );
	    
        $checker = mysql_query("SELECT 	`id`,
                        				`ip`,
                        				`name`
                                FROM 	`chat`
                                WHERE 	`status`   = 0
                                AND 	`actived`  = 1;");
        
        while ($checker_row = mysql_fetch_assoc($checker)){
            $data[chat][] = '<tr>
                        <td style="display:none;">'.$checker_row[id].'</td>
                        <td>IP: '.$checker_row[ip].'</td>
                        <td>'.$checker_row[name].'</td>
                      </tr>';
        }
		break;
	case 'get_list' :

		break;
	case 'save_incomming':

		break;
	default:
		$error = 'Action is Null';
}

$data['error'] = $error;

echo json_encode($data);


/* ******************************
 *	Request Functions
* ******************************
*/

function GetPage()
{
	
	$data  = '';

	return $data;
}

?>